#ifndef _MenuPage_H_
#define _MenuPage_H_

#include "MenuItem.h"
#include "../Graphics/Font.h"
#include "../Utils/Vector2D.h"

#include <map>
#include <vector>
#include <iostream>
#include <string>


class MenuPage {
  public:

    MenuPage();
    virtual ~MenuPage();

    virtual void render();

    virtual void activate();
    
    virtual void update();
    
    virtual void select(float x, float y);

    virtual void move(bool);

  protected:

    float page_top;
    float page_bot;
    float page_left;
    float page_right;

    float title_left;
    float title_right;
    float title_top;
    float title_bot;

    float items_top;
    float items_bot;
    float items_left;
    float items_right;

    Vector2D mouse_pos;

    // page title
    std::string title;

    // currently selected item
    int current_item;
    int current_top_item;
    int num_items;

    // move up and down menuitems
    MenuItem* move_up;
    MenuItem* move_down;

    // a list of menu items
    std::vector<MenuItem*> items;
//    std::map<int,MenuItem*> items;
    // a list of top/bot regions for each item
//    std::map<int,Vector2D> select_regions;
//    std::map<int,Vector2D> display_regions;
    std::vector<Vector2D> select_regions;
    std::vector<Vector2D> display_regions;
    
    int num_regions;

    Font menu_font;

};

#endif

